package com.black.opsapi.feign.fallback;

import com.black.opsapi.feign.RemotePermissionService;
import com.black.opscommon.entity.Permission;
import com.black.opscommon.utils.R;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Set;

/**
 * @author qiang.zhang
 * @date 2019/2/1
 */
@Slf4j
@Component
public class RemotePermissionServiceFallbackImpl implements RemotePermissionService {
	@Setter
	private Throwable cause;

	/**
	 * 通过用户名查询用户、角色信息
	 *
	 * @param roleId   角色ID
	 * @param from     内外标志
	 * @return R
	 */
	@Override
	public R<Set<Permission>> findByRoles_Id(Long roleId, String from) {
		log.error("feign 查询用户信息失败:{}", roleId, cause);
		return null;
	}

}
